﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RemoteImaging.Controls
{
    using RemoteImaging;
    public class AutoDisposePictureEdit : DevExpress.XtraEditors.PictureEdit
    {
        private System.Drawing.Image _oldImg;

        protected override void OnEditValueChanged()
        {
            base.OnEditValueChanged();

            if (_oldImg != null)
            {
                _oldImg.Dispose();
            }

            _oldImg = EditValue as System.Drawing.Image;
        }
    }
}
